#include "characters/enemies/StudentEnemy.hh"
#include "characters/enemies/Enemy.hh"

#include <iostream>
#include <string>

// Constructor
StudentEnemy::StudentEnemy()
    : Enemy("Student Spirit",
            "A collective entity formed from the grievances of many students",
            150, // Health (Example value)
            150, // Max Health (Example value)
            60,  // Attack (Example value, seems reasonable for annoyance)
            40), // Defense (Example value, low defense)
      speed(15)  // Speed from design doc
{
    std::cout << getName() << " coalesces from the shadows!" << std::endl;
}

bool StudentEnemy::attack(ICharacter &target)
{
    if (!isAlive())
        return false;

    std::cout << getName() << " lunges erratically at " << target.getName() << "!" << std::endl;

    unsigned damageDealt = getAttackPower();

    bool targetSurvived = target.takeDamage(damageDealt);

    if (!targetSurvived)
    {
        std::cout << target.getName() << " was overwhelmed by the怨念!" << std::endl;
    }
    return targetSurvived;
}

int StudentEnemy::getSpeed() const
{
    return speed;
}